package com.application.Adapter;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.CompoundButton.OnCheckedChangeListener;

import com.application.Activity.R;
import com.application.Adapter.RoleAdapter.ViewHolder;
import com.application.RowDTO.RoleRowDTO;

public class ListStringAdapter extends BaseAdapter{
	public static class ViewHolder {
		TextView txtTextShow;
	
	}

	private Activity activity;
	private LayoutInflater inflater;
	private ArrayList<String> data;

	public ListStringAdapter(Activity activity, ArrayList<String> data) {
		this.activity = activity;
		this.data = data;
		this.inflater = (LayoutInflater) activity
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}

	@Override
	public int getCount() {

		return data.size();
	}

	@Override
	public Object getItem(int position) {

		return data.get(position);
	}

	@Override
	public long getItemId(int position) {

		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {

		View view = convertView;
		if (view == null) {
			view = inflater.inflate(R.layout.list_liststring, null);
			
			ViewHolder viewHolder = new ViewHolder();
			
			viewHolder.txtTextShow = (TextView) view.findViewById(R.id.txtStringShow);
//			viewHolder.btnDownload = (Button) view.findViewById(R.id.btnDownload);
			view.setTag(viewHolder);
		}
		ViewHolder holder = (ViewHolder) view.getTag();
		holder.txtTextShow.setText(data.get(position));
	//	
		return view;
	}
}
